/*
 * Copyright 2003-2007 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */

package com.colony.remote.rpc;

import java.util.HashMap;

public class RpcDelegateFactory
{
	private HashMap _delegates;
	
	public RpcDelegateFactory()
	{
		_delegates = new HashMap();
	}
	public void setBackDelegate( Class clss, RpcDelegate delegate )
	{
		_delegates.put( clss, delegate );
	}
	
	public RpcDelegate getBackDelegate(Class clss ) 
	{
		RpcDelegate delegate = (RpcDelegate) _delegates.get( clss );
		if (delegate!=null)
			return delegate;
		
		delegate = new RpcMetaSkeleton();
		setBackDelegate( clss, delegate );
		return delegate;
	}
}
